package hanbo.controller;



import hanbo.entity.HanBoEntity;
import hanbo.service.HanBoService;

import javax.annotation.Resource;
import java.util.List;

public class HanBoController {
    List<HanBoEntity> list = null;
   HanBoEntity hanBoEntity=null;
    String name = null;
    String flag = "0";
    @Resource
    HanBoService hanBservice;

    public String queryPage(){
        list =hanBservice.queryPage(name);
        return "queryPage";
    }

    public String save(){
        hanBservice.save(hanBoEntity);
        flag = "1";
        return "save";
    }
    //@Resource @Autowired 作用相同 去spring容器中到bean实例
    //@Service @Component 向spring 容器中放入bean（类的对象）实例


    public List<HanBoEntity> getList() {
        return list;
    }

    public HanBoEntity getHanBoEntity() {
        return hanBoEntity;
    }

    public void setHanBoEntity(HanBoEntity hanBoEntity) {
        this.hanBoEntity = hanBoEntity;
    }

    public HanBoService getHanBservice() {
        return hanBservice;
    }

    public void setHanBservice(HanBoService hanBservice) {
        this.hanBservice = hanBservice;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setList(List<HanBoEntity> list) {
        this.list = list;
    }
}
